//
//  LJJVisitorViewController.swift
//  Swift--weibo
//
//  Created by 李久健 on 16/8/9.
//  Copyright © 2016年 lijiujian. All rights reserved.
//

import UIKit

class LJJVisitorViewController: UIViewController {

    //判断用户是否登录
    var isLogin: Bool = false
    
    //访客视图 View
    var visitorView: LJJVisitorView?
    
    override func loadView() {
        if isLogin {
            super.loadView()
        }else{
            setupVisitorView()
        }
    }
    //MARK 设置访客视图
    func setupVisitorView(){
//        setupNav()
        visitorView = LJJVisitorView()
        view = visitorView
    }
    //设置导航
    func setupNav(){
        navigationItem.leftBarButtonItem = UIBarButtonItem(title: "注册", style: UIBarButtonItemStyle.Plain, target:self, action: "loginAction")
        navigationItem.rightBarButtonItem = UIBarButtonItem(title: "登录", style: UIBarButtonItemStyle.Plain, target: self, action: "loginAction")
    }
    
    //MARK 监听放法
    func loginAction(){
        print("登录和注册按钮点击")
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
    }
}
